<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center zhipaiUser_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub zhipaiUser_fd0_0'>
          <view class='flex flex-wrap align-center zhipaiUser_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  zhipaiUser_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='zhipaiUser_fd0_0_c1_c0'>指派他人</text>
          </view>
          <view class='flex flex-wrap align-center justify-end zhipaiUser_fd0_0_c0' @click.stop="submit">
            <text>确定</text>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <view class='flex flex-wrap align-center justify-between zhipaiUser_fd1_0' v-for="(item,index) in dataList"
          :key="index" @click.stop="chooseUser(item)">
          <view class='flex flex-wrap align-center flex-sub'>
            <image class='zhipaiUser_fd1_0_c0_c0' mode="aspectFill" :src='item.avatar'></image>
            <text class='zhipaiUser_fd1_0_c0_c1'>{{item.nickname}}</text>
          </view>
          <view class='flex flex-wrap align-center'>
            <image class='zhipaiUser_fd1_0_c1_c0' v-if="chooseId==item.id" mode="aspectFit" :src='STATIC_URL+"37.png"'>
            </image>
            <image class='zhipaiUser_fd1_0_c1_c0' v-else mode="aspectFit" :src='STATIC_URL+"16.png"'></image>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </page-body>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';

  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        dataList: [],
        company_id: '',
        chooseId: '',
        aid: '',
        user_id_2: ''
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {
      this.aid = options.aid
      this.getListFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      submit() {
        this.$api.post(global.apiUrls.post6658352823dcc, {
          aid: this.aid,
          user_id_2: this.chooseId
        }).then(res => {
          this.$message.info(res.data.msg)
          if (res.data.code == 1) {
            setTimeout(result => {
              uni.navigateBack()
            }, 800)
          }
        })
      },
      chooseUser(item) {
        this.chooseId = item.id
      },
      //用户管理-意见反馈记录
      getListFunc() {
        this.minixPagingListsApi = global.apiUrls.post66583f4fb5d8a;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          company_id: this.aid
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .zhipaiUser_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .zhipaiUser_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .zhipaiUser_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .zhipaiUser_fd0_0_c0 {
    width: 120rpx;
  }

  .zhipaiUser_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .zhipaiUser_fd1_0_c1_c0 {
    width: 36rpx;
    height: 36rpx;
  }

  .zhipaiUser_fd1_0_c0_c1 {
    max-width: 300rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .zhipaiUser_fd1_0_c0_c0 {
    width: 120rpx;
    height: 120rpx;
    border-radius: 16rpx;
    margin: 0rpx 32rpx 0rpx 0rpx;
  }

  .zhipaiUser_fd1_0 {
    width: 702rpx;
    margin: 24rpx auto 0rpx auto;
  }
</style>
